import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

const useUserInfoStore = defineStore('userInfo', () => {

  const userInfo = ref(sessionStorage.getItem('userInfo') || {})

  const myUserInfo = computed(() => userInfo.value)

  function saveUserInfo(userInfo) {
    this.userInfo = userInfo
  }

  

  return { myUserInfo, saveUserInfo}
})

export default useUserInfoStore
